<%--
违规类别列表页面
@author <a href="mailto:chenfenghai@ceopen.cn">chenfenghai</a>
action ：violationCategoryAction
method ：initList
created ：2010-10-13
--%>
<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/commonList.jsp"%>
<%@ include file="/commons/validation.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>违规类别列表</title>
<script language="JavaScript" type="text/javascript"
	src="${ctx}/scripts/common.js"></script>
<script language="JavaScript" type="text/javascript"
	src="${ctx}/scripts/ajaxException.js"></script>
<script type="text/javascript">
	var currentID = null;
	function edit(){
		if(currentID == null || currentID ==""){
			Alert("请选择要修改的记录");
			return;
		}
		parent.openCategoryEdit(currentID);
	}
	function openDelete(){
		if(currentID == null || currentID ==""){
			Alert("请选择要删除的记录");
			return;
		}
		//验证是否可删除
		var url = "${ctx }/system_violationCategoryAction.do?method=validateDelete&keyword="+currentID;
        new Ajax.Request(url,{method: 'post',parameters :{} ,onSuccess : function(response){
	            ajaxSubmitException(response.responseText);
	       		if("true" != response.responseText){
		        	ErrorAlert("该违规类别已经关联了违规记录，不得进行删除！");
		        }else{
		        	AskConfirm("您确认删除此条记录吗?","main","openCategoryDelete");
		        }
        	}});
		
	}

	function init(){
		parent.marker = 1;
	}
</script>
</head>
<body onload="init();">
<div style="overflow: auto; height: 340px;"><ec:ceTable
	items="categoryList"
	action="${ctx}/system_violationCategoryAction.do?method=initList"
	var="categoryVO" view="pmsview" styleClass="gridData2"
	rowsDisplayed="15">
	<ec:ceRow styleClass="grid" onclick="currentID=${categoryVO.keyword}"
		onContextMenu="return ShowContextMenu(event,'quick_rightmenu');">
		<ec:ceColumn headerCell="pmsHeadrCell" title="类别名称" property="name"
			width="20%" />
		<ec:ceColumn headerCell="pmsHeadrCell" title="类别说明"
			property="description" width="50%" />
		<ec:ceColumn headerCell="pmsHeadrCell" title="序号"
			property="sortNumber" width="10%" />
		<ec:ceColumn headerCell="pmsHeadrCell" title="使用状态"
			property="statusName" width="20%" />
	</ec:ceRow>
</ec:ceTable></div>
<div id="quick_rightmenu" style="display: none;"
	oncontextmenu="return false" class="quick_rightmenu">
<table width="100%" border="0" cellpadding="1" cellspacing="0"
	class="grid_quickMenu_bg">
	<tr>
		<td>
		<table width="100%" border="0" cellpadding="2" cellspacing="0">

			<tr>
				<td class="quickMenu_toolbarico"><a href="#"
					onClick="parent.openCategoryAdd();" onFocus="this.blur()"> <img
					src="${ctx}/images/ico_newfile.gif" alt="" width="16" height="16"
					border="0" align="absbottom" /> &nbsp;新 建</a></td>
			</tr>

			<tr>
				<td class="quickMenu_toolbarico"><a href="#" onClick="edit();"
					onFocus="this.blur()"> <img src="${ctx}/images/ico_amend.gif"
					alt="" width="16" height="16" border="0" align="absbottom" />
				&nbsp;修 改</a></td>
			</tr>
			<tr>
				<td class="quickMenu_toolbarico"><a href="#"
					onClick="openDelete();" onFocus="this.blur()"> <img
					src="${ctx}/images/ico_delete.gif" alt="" width="16" height="16"
					border="0" align="absbottom" /> &nbsp;删 除</a></td>
			</tr>

		</table>
		</td>
	</tr>
</table>
</div>
</body>
</html>